let globalData = getApp().globalData;
export const http = (params) => {
    const token = wx.getStorageSync('token') || '';
    return new Promise((reslove, reject) => {
        wx.request({
            ...params,
            url: globalData.URL + '/api' + params.url,
            header: {
                Authorization: token
            },
            method: 'POST',

            success: (result) => {
                reslove(result)
            },
            fail: (err) => {
                reject(err)
            }
        })
    })
}